<template>
	<view class="integral">
		<navbar :showBack="true">我的积分</navbar>
		<view class="user_integral">
			<view class="header">
				<view class="currentScore">当前积分</view>
				<view class="scoreNum">{{userSignInfo.integral}}</view>
				<view class="line"></view>
				<view class="nav acea-row">
					<view class="item">
						<view class="num">{{userSignInfo.sum_integral}}</view>
						<view>累计积分</view>
					</view>
					<view class="item">
						<view class="num">{{userSignInfo.deduction_integral}}</view>
						<view>累计消费</view>
					</view>
					<view class="item">
						<view class="num">{{userSignInfo.today_integral}}</view>
						<view>今日获得</view>
					</view>
				</view>
			</view>
			<view class="wrapper">
				<view class="nav acea-row">
					<view class="item acea-row row-center-wrapper" :class="show==1?'on':''" @click="change(1)">
						<text class="iconfont icon-mingxi"></text>
						分值明细
					</view>
					<view class="item acea-row row-center-wrapper" :class="show==1?'':'on'" @click="change(2)">
						<text class="iconfont icon-tishengfenzhi"></text>
						分值提升
					</view>
				</view>
				<view class="list" v-if="show==1">
					<view class="item acea-row row-between-wrapper" v-for="(item,index) in list" :key="index">
						<view>
							<view class="state">{{item.mark}}</view>
							<view>{{item.add_time}}</view>
						</view>
						<view class="num" :class="item.pm==1?'font-color':''">{{item.pm==1?'+':'-'}}{{item.number}}</view>
					</view>
					<navigator url="/pages/pack/user_integral_list/user_integral_list" class="seeMore">查看更多</navigator>
				</view>
				<view class="list2" v-if="show==2">
					<navigator url="/pages/goods_cate/goods_cate" class="item acea-row row-between-wrapper" open-type="switchTab">
						<view class="pic"><image src="../static/images/score.png" mode=""></image></view>
						<view class="name">购买商品可获得积分奖励</view>
						<view class="earn">赚积分</view>
					</navigator>
					<navigator url="/pages/pack/user_sign/user_sign" class="item acea-row row-between-wrapper">
						<view class="pic"><image src="../static/images/score.png" mode=""></image></view>
						<view class="name">每日签到可获得积分奖励</view>
						<view class="earn">赚积分</view>
					</navigator>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from "@/api/api.js";
	export default{
		data(){
			return{
				show:1,
				userSignInfo:{},
				list:[]
			}
		},
		onShow() {
			this.init()
		},
		methods:{
			init:function(){
				this.getSignUser()
				this.getIntegralList()
			},
			getSignUser:function(){
				const that = this;
				api.sign.signUser().then(e=>{
					if(e.status == 200){
						that.userSignInfo = e.data
					}
				})
			},
			getIntegralList:function(){
				const that = this;
				api.user.getIntegralList(1,6).then(e=>{
					if(e.status == 200){
						that.list = e.data
					}
				})
			},
			change:function(show){
				this.show = show
			}
		}
	}
</script>

<style>
	.user_integral .header{
		background-image: url("data: image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwkHBgoJCAkLCwoMDxkQDw4ODx4WFxIZJCAmJSMgIyIoLTkwKCo2KyIjMkQyNjs9QEBAJjBGS0U+Sjk/QD3/2wBDAQsLCw8NDx0QEB09KSMpPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT3/wgARCAHMAu4DAREAAhEBAxEB/8QAGQABAQEBAQEAAAAAAAAAAAAAAAECAwQF/8QAGQEBAQEBAQEAAAAAAAAAAAAAAAECAwUH/9oADAMBAAIQAxAAAAD5nh/QwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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S/5/QhCEIQhCEIQhCEIQhCEIQhNqZGRkZFMjIyMi7YmJiYmJiYmJiYGBgYmJiYmJiQnlmtoTaE2S9La6IRE6EvTp3QXqEJ1JCXqs2S8T//2Q==");
		background-repeat: no-repeat;
		background-size: 100% 100%;
		width: 100%;
		height: 460rpx;
		font-size: 72rpx;
		color: #fff;
		padding: 31rpx 0 45rpx 0;
		box-sizing: border-box;
		text-align: center;
		font-family: 'Guildford Pro';
	}
	.user_integral .header .currentScore{
		font-size: 26rpx;
		color: rgba(255, 255, 255, 0.8);
		text-align: center;
		margin-bottom: 11rpx;
	}
	.user_integral .header .scoreNum{
		font-family: "Guildford Pro";
	}
	.user_integral .header .line{
		width: 60rpx;
		height: 3rpx;
		background-color: #fff;
		margin: 20rpx auto 0;
	}
	.user_integral .header .nav{
		font-size: 22rpx;
		color: rgba(255, 255, 255, 0.8);
		flex: 1;
		margin-top: 35rpx;
	}
	.user_integral .header .nav .item{
		width: 33.33%;
		text-align: center;
	}
	.user_integral .header .nav .item .num{
		color: #fff;
		font-size: 40rpx;
		margin-bottom: 5rpx;
		font-family: 'Guildford Pro';
	}
	.user_integral .wrapper .nav{
		flex: 1;
		width: 690rpx;
		border-radius: 20rpx 20rpx 0 0;
		margin: -96rpx auto 0 auto;
		background-color: #f7f7f7;
		height: 96rpx;
		font-size: 30rpx;
		color: #bbb;
	}
	.user_integral .wrapper .nav .item{
		text-align: center;
		width: 50%;
	}
	.user_integral .wrapper .nav .item.on{
		background-color: #fff;
		color: #e93323;
		font-weight: bold;
		border-radius: 20rpx 0 0 0;
	}
	.user_integral .wrapper .list{
		background-color: #fff;
		padding: 24rpx 30rpx;
	}
	.user_integral .wrapper .list .item{
		height: 124rpx;
		border-bottom: 1rpx solid #eee;
		font-size: 24rpx;
		color: #999;
	}
	.user_integral .wrapper .list .item .state{
		font-size: 28rpx;
		color: #282828;
		margin-bottom: 8rpx;
	}
	.user_integral .wrapper .list .item .num{
		font-size: 36rpx;
		font-family: 'Guildford Pro';
	}
	.user_integral .wrapper .list .seeMore{
		width: 100%;
		height: 60rpx;
		line-height: 60rpx;
		text-align: center;
		font-size: 30rpx;
		margin-top: 20rpx;
		font-family: 'Guildford Pro';
		color: #999;
	}
	.user_integral .wrapper .list2{
		background-color: #fff;
		padding: 24rpx 0;
	}
	.user_integral .wrapper .list2 .item{
		background-image: linear-gradient(to right, #fff7e7 0%, #fffdf9 100%);
		width: 690rpx;
		height: 180rpx;
		position: relative;
		border-radius: 10rpx;
		margin: 0 auto 20rpx auto;
		padding: 0 25rpx 0 180rpx;
		box-sizing: border-box;
	}
	.user_integral .wrapper .list2 .item .pic{
		width: 90rpx;
		height: 150rpx;
		position: absolute;
		bottom: 0;
		left: 45rpx;
	}
	.user_integral .wrapper .list2 .item .name{
		width: 285rpx;
		font-size: 30rpx;
		font-weight: bold;
		color: #c8a86b;
	}
	.user_integral .wrapper .list2 .item .earn{
		font-size: 26rpx;
		color: #c8a86b;
		border: 2rpx solid #c8a86b;
		text-align: center;
		line-height: 52rpx;
		height: 52rpx;
		width: 160rpx;
		border-radius: 50rpx;
	}
</style>
